using System.Drawing;

namespace SharpWind.Gui.Controls
{
	public class CheckBox : CheckBoxBase
	{
		private Label label = null;

		public CheckBox() : base( "checkbox" )
		{
			this.label           = new Label();
			this.label.Font		 = Engine.Instance.Scene.Controls.Theme.Font;
			this.label.Text      = "checkBox";
			this.label.TextAlign = TextAlign.MiddleLeft;
			this.label.TextColor = Color.Black;
			Size				 = new SizeF( 80, 20 );
		}

		internal override void Render()
		{
			if( Visible )
			{
				base.Render();
				this.label.Render();
			}
		}

		public override SizeF Size
		{
			get
			{
				return base.Size;
			}
			set
			{
				base.Size = new SizeF( value.Height, value.Height );
				this.label.Size = new SizeF( value.Width - value.Height + 3, value.Height );
			}
		}

		public override PointF Location
		{
			get
			{
				return base.Location;
			}
			set
			{
				base.Location = value;
				this.label.Location = new PointF( value.X + Size.Height + 3, value.Y );
			}
		}

		public SharpWind.Resources.Font Font
		{
			get
			{
				return this.label.Font;
			}
			set
			{
				this.label.Font = value;
			}
		}

		public string Text
		{
			get
			{
				return this.label.Text;
			}
			set
			{
				this.label.Text = value;
			}
		}

		public TextAlign TextAlign
		{
			get
			{
				return this.label.TextAlign;
			}
			set
			{
				this.label.TextAlign = value;
			}
		}

		public Color TextColor
		{
			get
			{
				return this.label.TextColor;
			}
			set
			{
				this.label.TextColor = value;
			}
		}
	}
}